package com.foreknow.elmboot.controller;

import com.foreknow.elmboot.po.User;
import com.foreknow.elmboot.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/UserController")
public class UserController {
    @Autowired
    private UserService userService;

    @RequestMapping("/getUserByIdByPass")
    public Object getUserByIdByPass(User user){
        return userService.sgetUserByIdByPass(user.getUserId(),user.getPassword());
    }

    @RequestMapping("/getUserById")
    public Object getUserById(User user){
        return userService.sgetUserById(user.getUserId());
    }

    @RequestMapping("/saveUser")
    public Object saveUser(User user){

        return userService.ssaveUser(user);
    }
}
